<CFPARAM NAME="lPreProcessShowMsg" DEFAULT="Yes">
<CFIF lPreProcessShowMsg EQ "Yes">
<table border=0 cellpadding="1px" cellspacing=0 width="100%">
</CFIF>
<CFQUERY NAME="qryCLKLVCODE" DATASOURCE=#client.company_dsn#>
	SELECT WITHBALANCE, ALLOWNEGBALANCE
	FROM CLKLVCODE
	WHERE LEAVETYPE = '#GetEntry.LEAVETYPE#'
</CFQUERY>
<CFQUERY NAME="qryCINWSMASTER" DATASOURCE=#client.company_dsn#>
	SELECT A.PERSONNELIDNO, A.WORKSKEDCODE, A.STARTDATE, B.MONDAY, B.TUESDAY, B.WEDNESDAY, B.THURSDAY, B.FRIDAY, B.SATURDAY, B.SUNDAY
	FROM CINWSMASTER A, CLKWORKSKED B
	WHERE (A.PERSONNELIDNO = '#GETENTRY.PERSONNELIDNO#') 
	AND (A.ACTIVESKED = 'Y') AND (A.STARTDATE =
		(SELECT MAX(STARTDATE) AS STARTDATE
		FROM CINWSMASTER
		WHERE (PERSONNELIDNO = '#GETENTRY.PERSONNELIDNO#') AND (ACTIVESKED = 'Y')))
		AND A.WORKSKEDCODE = B.WORKSKEDCODE
</CFQUERY>
<CFQUERY NAME="qryCINLEAVEAPPSM" DATASOURCE=#client.company_dsn#>
	SELECT STARTINGDATE,ENDINGDATE,NOOFDAYS,LEAVEHOURS,LEAVETYPE
	FROM CINLEAVEAPPSM
		WHERE (STARTINGDATE <= '#GetEntry.STARTINGDATE#' AND ENDINGDATE >='#GetEntry.ENDINGDATE#')
		AND PERSONNELIDNO='#GetEntry.PERSONNELIDNO#' 
		AND (APPROVED='Y' OR APPROVED='C')
		AND (LEAVETYPE='#GetEntry.LEAVETYPE#')
</CFQUERY>
<CFIF qryCINLEAVEAPPSM.RECORDCOUNT>
	<CFSET nDeductedDay = 0>
	<CFSET isCompareMaster= DateCompare("#qryCINLEAVEAPPSM.STARTINGDATE#", "#qryCINLEAVEAPPSM.ENDINGDATE#", "d")>
	<CFSET isCompareRecall= DateCompare("#GetEntry.STARTINGDATE#", "#GetEntry.ENDINGDATE#", "d")>
	<!---<CFSET isValidNoofDays= CompareNoCase("#qryCINLEAVEAPPSM.NOOFDAYS#","#GetEntry.NOOFDAYS#")>--->
	<CFSET isValidNoofHours= CompareNoCase("#qryCINLEAVEAPPSM.LEAVEHOURS#","#GetEntry.LEAVEHOURS#")>
	<CFIF (isCompareMaster LTE 0 AND isCompareRecall LTE 0)>
		<CFSET isValidStartDate= DateCompare("#GetEntry.STARTINGDATE#", "#qryCINLEAVEAPPSM.STARTINGDATE#", "d")>
		<CFSET isValidEndDate= DateCompare("#qryCINLEAVEAPPSM.ENDINGDATE#", "#GetEntry.ENDINGDATE#", "d")>
	<CFELSE>
		<CFIF lPreProcessShowMsg EQ "Yes">
		<tr><td nowrap class="bold">Start Date is greater than End Date.</td></tr>
		</CFIF>
	</CFIF>
	<!---<CFIF lPreProcessShowMsg EQ "Yes">
		<tr><td nowrap class="bold">No of days to be recalled exceeds no. of days applied.</td></tr>
	</CFIF>--->

	<CFIF NOT qryCINWSMASTER.RecordCount> <!--- Check CINWSMASTER for Work Sked --->
		<CFIF lPreProcessShowMsg EQ "Yes">
			<tr><td nowrap class="bold">Employee Worksked not properly set-up.</td></tr>
		</CFIF>
	<!---<CFELSEIF isValidNoofDays LT 0>
		<CFIF lPreProcessShowMsg EQ "Yes">
		<tr><td nowrap class="bold">No of days to be recalled exceeds no. of days applied.</td></tr>
		</CFIF>--->
	<!---<CFELSEIF isValidNoofHours LT 0 AND isValidNoofDays LTE 0>
		<CFIF lPreProcessShowMsg EQ "Yes">
		<tr><td nowrap class="bold">Invalid information supplied. Please check leave hours/no of days to be recalled.</td></tr>
		</CFIF>--->
	<CFELSEIF NOT qryCLKLVCODE.RecordCount>
		<CFIF lPreProcessShowMsg EQ "Yes">
		<tr><td nowrap class="bold">Leave Type not found in Lookup table.</td></tr>
		</CFIF>
	<CFELSEIF Trim(Ucase(qryCLKLVCODE.WITHBALANCE)) IS "N">
		<CFIF lPreProcessShowMsg EQ "Yes">
		<tr><td nowrap class="bold">Leave Type has unlimited balance.</td></tr>
		</CFIF>
		<CFSET lPreProcessValidated="Yes">
	<CFELSEIF isValidStartDate LT 0 OR isValidEndDate LT 0>
		<CFIF lPreProcessShowMsg EQ "Yes">
		<tr><td nowrap class="bold">Leave Recall is not valid. Leave being recalled is not inclusive in the applied Leave</td></tr>
		</CFIF>
	<CFELSEIF NOT qryCINLEAVEAPPSM.RecordCount>
		<CFIF lPreProcessShowMsg EQ "Yes">
		<tr><td nowrap class="bold">Leave Recall is not valid.</td></tr>
		</CFIF>
	<CFELSE>
		<CFQUERY NAME="qryCINLVENTITLEMENT" DATASOURCE="#client.company_dsn#">
			SELECT LEAVEENTITLEMENT, TYPE, STARTDATE, ACCRUEDBALANCE, ACCRUEDBALANCEASOF,
					LEAVEBALANCE, LEAVEBALANCEASOF, AVAILEDLEAVE, AVAILEDLEAVEASOF, LEAVETYPE
			FROM CINLVENTITLEMENT
			WHERE PERSONNELIDNO = '#GetEntry.PERSONNELIDNO#' AND
				LEAVETYPE = '#GetEntry.LEAVETYPE#'
		</CFQUERY>
	
		<CFIF qryCINLVENTITLEMENT.RecordCount>
			<CFQUERY NAME="qryCBR201" DATASOURCE=#client.company_dsn# MAXROWS=1>
				SELECT LEAVETRACKUNIT
				FROM CBR201
			</CFQUERY>
	
			<CFIF qryCBR201.RecordCount>
				<!--- Check workingdayscode --->
				<CFQUERY NAME="qryCMFPA" DATASOURCE="#client.company_dsn#">
					SELECT *
					FROM CMFPA
					WHERE PERSONNELIDNO = '#GetEntry.PERSONNELIDNO#'
				</CFQUERY>
	
				<CFQUERY NAME="qryCLKWORKINGDAYS" DATASOURCE="#client.company_dsn#">
					SELECT WORKINGHOURSPDAY,WORKINGHOURSFORLV
					FROM CLKWORKINGDAYS
					WHERE WORKINGDAYSCODE = '#qryCMFPA.WORKINGDAYSCODE#'
				</CFQUERY>
	
				<CFIF qryCLKWORKINGDAYS.RecordCount>
					<!--- Check if noofhours exceed noofdays --->
					<CFSET nHoursInDays=DateDiff("d", Evaluate("GetEntry.STARTINGDATE"), Evaluate("GetEntry.ENDINGDATE")) + 1>
	<!---			modified by soti to be in sync with leaveprompt.cfm
					<CFSET nHoursApplied=Evaluate("GetEntry.LEAVEHOURS")>
	--->			
					<CFSET sWithTempSked = "">
					<CFSET sWithSubSked = "">
					<CFSET dSubSked = "">
					<!--- by Maan 05102007 deduct holidays and rest day/day off--->
					<CFQUERY NAME="qryCINWSSUBSKED" DATASOURCE="#client.company_dsn#">
						SELECT A.REFERENCEDATE, A.PERSONNELIDNO, A.PATTERNCODE
						FROM CINWSSUBSKED A, CLKWSPATTERN B
						WHERE A.PATTERNCODE = B.PATTERNCODE AND A.PERSONNELIDNO = '#GetEntry.PERSONNELIDNO#' AND  B.DAYTYPE IN ('DO','RD')
					</CFQUERY>
					<CFIF qryCINWSSUBSKED.RECORDCOUNT NEQ 0>
						<CFLOOP QUERY="qryCINWSSUBSKED">
							<CFSET dSubSked = ListAppend(dSubSked,DateFormat(REFERENCEDATE,"mm/dd/yyyy"))>
						</CFLOOP>
					</CFIF>
					<!--- pre process tempsked --->
					<CFQUERY NAME="qryCINWSTEMPSKED" DATASOURCE="#client.company_dsn#">
						SELECT A.PERSONNELIDNO, A.WORKSKEDCODE, A.STARTDATE, A.ENDDATE, B.MONDAY, B.TUESDAY, B.WEDNESDAY, B.THURSDAY, B.FRIDAY, B.SATURDAY, B.SUNDAY
						FROM CINWSTEMPSKED A, CLKWORKSKED B
						WHERE (PERSONNELIDNO = '#GetEntry.PERSONNELIDNO#') AND (A.ENDDATE =
							(SELECT MAX(ENDDATE) AS ENDDATE
							FROM CINWSTEMPSKED
							WHERE PERSONNELIDNO = '#GetEntry.PERSONNELIDNO#')) AND A.WORKSKEDCODE = B.WORKSKEDCODE
					</CFQUERY>
					<CFQUERY NAME="qryCLKWSHOLIDAYS" DATASOURCE="#client.company_dsn#">
						SELECT HOLIDAYMONTH,HOLIDAYDAY,HALF_DAY
						FROM CLKWSHOLIDAYS
					</CFQUERY>	
					<CFSET theDate= #DATEFORMAT(GETENTRY.STARTINGDATE, "mm/dd/yyyy")#>
					<CFSET sNoofDays= DateDiff("d", "#GETENTRY.STARTINGDATE#", "#GETENTRY.ENDINGDATE#") + 1>
					<CFSET theRefDate="">
					<CFSET holidaycount="">
					<cfset dates = "">
					<!--- start the validation, process date by date --->
					<CFLOOP index="holidaycount" FROM="1" TO="#sNoofDays#" STEP="1">
						<CFSET nDay = DayOfWeek(theDate)>
						<CFSET nNonHolidayMonth=DateFormat("#theDate#","m")>
						<CFSET nNonHolidayDay=DateFormat("#theDate#","d")>
						<CFSET isHoliday = "No">
						<CFSET stheDay = "">
						
						<!--- subsked first--->
						<CFIF ListFind(dSubSked,DateFormat(theDate,"mm/dd/yyyy")) NEQ "0">
						<cfset session.11wats = "subsked">
							<CFSET subRefDate = ListGetAt(dSubSked, ListFind(dSubSked,DateFormat(theDate,"mm/dd/yyyy")))>
							<!--- this rd/do by subsked must not be a holiday --->	
							<CFLOOP QUERY="qryCLKWSHOLIDAYS">
								<CFIF HOLIDAYMONTH EQ nNonHolidayMonth AND HOLIDAYDAY EQ nNonHolidayDay>
									<!--- it is a holiday! --->
									<CFSET nDeductedDay=nDeductedDay + 1>
									<CFSET isHoliday = "Yes">
									<cfset dates = ListAppend(dates,DateFormat(theDate,"mm/dd/yyyy"))>
								</CFIF>
							</CFLOOP>
							<CFIF isHoliday EQ "No">
								<CFSET nDeductedDay=nDeductedDay + 1>
								<cfset dates = ListAppend(dates,DateFormat(theDate,"mm/dd/yyyy"))>
							</CFIF>
						<CFELSEIF qryCINWSTEMPSKED.ENDDATE GTE theDate AND theDate NEQ qryCINWSSUBSKED.REFERENCEDATE>
						<!--- if not subsked, tempsked next --->
						<cfset session.11watt = "tempsked">
							<CFIF qryCINWSTEMPSKED.STARTDATE LTE getEntry.STARTINGDATE>
								<CFIF qryCINWSTEMPSKED.MONDAY    EQ "RD" OR qryCINWSTEMPSKED.MONDAY    EQ "DO"><CFSET stheDay = ListAppend(stheDay,"2")></CFIF>
								<CFIF qryCINWSTEMPSKED.TUESDAY   EQ "RD" OR qryCINWSTEMPSKED.TUESDAY   EQ "DO"><CFSET stheDay = ListAppend(stheDay,"3")></CFIF>
								<CFIF qryCINWSTEMPSKED.WEDNESDAY EQ "RD" OR qryCINWSTEMPSKED.WEDNESDAY EQ "DO"><CFSET stheDay = ListAppend(stheDay,"4")></CFIF>
								<CFIF qryCINWSTEMPSKED.THURSDAY  EQ "RD" OR qryCINWSTEMPSKED.THURSDAY  EQ "DO"><CFSET stheDay = ListAppend(stheDay,"5")></CFIF>
								<CFIF qryCINWSTEMPSKED.FRIDAY    EQ "RD" OR qryCINWSTEMPSKED.FRIDAY    EQ "DO"><CFSET stheDay = ListAppend(stheDay,"6")></CFIF>
								<CFIF qryCINWSTEMPSKED.SATURDAY  EQ "RD" OR qryCINWSTEMPSKED.SATURDAY  EQ "DO"><CFSET stheDay = ListAppend(stheDay,"7")></CFIF>
								<CFIF qryCINWSTEMPSKED.SUNDAY    EQ "RD" OR qryCINWSTEMPSKED.SUNDAY    EQ "DO"><CFSET stheDay = ListAppend(stheDay,"1")></CFIF>
							</CFIF>
							<CFLOOP LIST="#stheDay#" INDEX="noWork">
								<CFIF nDay EQ noWork>
									<CFSET nDeductedDay=nDeductedDay + 1>
									<cfset dates = ListAppend(dates,DateFormat(theDate,"mm/dd/yyyy"))>
									
								</CFIF>
							</CFLOOP>
							<!--- deduct holidays that are not rest day / day off--->
							<CFIF listFindNoCase(stheDay,nDay) NEQ "0">
								<CFLOOP QUERY="qryCLKWSHOLIDAYS">
									<CFIF HOLIDAYMONTH EQ nNonHolidayMonth AND HOLIDAYDAY EQ nNonHolidayDay>
										<!--- count every holiday in leave range --->
										<CFSET nDeductedDay=nDeductedDay + 1>
										<cfset dates = ListAppend(dates,DateFormat(theDate,"mm/dd/yyyy"))>
									</CFIF>
								</CFLOOP>
							</CFIF>
						<CFELSE>
						<!--- permanent sked --->
						<cfset session.11watp = "permanent">
							<CFIF qryCINWSMASTER.STARTDATE LTE getEntry.STARTINGDATE>
								<CFIF qryCINWSMASTER.MONDAY    EQ "RD" OR qryCINWSMASTER.MONDAY    EQ "DO"><CFSET stheDay ="2"></CFIF>
								<CFIF qryCINWSMASTER.TUESDAY   EQ "RD" OR qryCINWSMASTER.TUESDAY   EQ "DO"><CFSET stheDay = ListAppend(stheDay,"3")></CFIF>
								<CFIF qryCINWSMASTER.WEDNESDAY EQ "RD" OR qryCINWSMASTER.WEDNESDAY EQ "DO"><CFSET stheDay = ListAppend(stheDay,"4")></CFIF>
								<CFIF qryCINWSMASTER.THURSDAY  EQ "RD" OR qryCINWSMASTER.THURSDAY  EQ "DO"><CFSET stheDay = ListAppend(stheDay,"5")></CFIF>
								<CFIF qryCINWSMASTER.FRIDAY    EQ "RD" OR qryCINWSMASTER.FRIDAY    EQ "DO"><CFSET stheDay = ListAppend(stheDay,"6")></CFIF>
								<CFIF qryCINWSMASTER.SATURDAY  EQ "RD" OR qryCINWSMASTER.SATURDAY  EQ "DO"><CFSET stheDay = ListAppend(stheDay,"7")></CFIF>
								<CFIF qryCINWSMASTER.SUNDAY    EQ "RD" OR qryCINWSMASTER.SUNDAY    EQ "DO"><CFSET stheDay = ListAppend(stheDay,"1")></CFIF>
							</CFIF>
							<CFLOOP LIST="#stheDay#" INDEX="noWork">
								<CFIF nDay EQ noWork>
									<CFSET nDeductedDay=nDeductedDay + 1>
									<cfset dates = ListAppend(dates,DateFormat(theDate,"mm/dd/yyyy"))>
								</CFIF>
							</CFLOOP>
							<!--- deduct holidays that are not rest day / day off--->
							<!--- stheDay is the RD, DO; nDay is the currently processed day --->
							<CFIF listFindNoCase(stheDay,nDay) EQ "0">
								<CFLOOP QUERY="qryCLKWSHOLIDAYS">
									<CFIF HOLIDAYMONTH EQ nNonHolidayMonth AND HOLIDAYDAY EQ nNonHolidayDay>
										<!--- count every holiday in leave range --->
										<CFSET nDeductedDay=nDeductedDay + 1>
										<cfset dates = ListAppend(dates,DateFormat(theDate,"mm/dd/yyyy"))>
									</CFIF>
								</CFLOOP>
							</CFIF>
						</CFIF>
						<CFSET theDate= DATEFORMAT(DateAdd("D",1, "#theDate#"))>
					</CFLOOP>
					<cfset session.111mydate = dates>
					<!--- end of work sked/holiday validation --->
					
					<!--- the NOOFDAYS (START TO END DATE) less of holiday dates--->
					<CFSET nTotalLVDays = sNoofDays - nDeductedDay>
					
					<CFIF Trim(LCase(qryCBR201.LEAVETRACKUNIT)) IS "by day">
						<CFSET nHoursApplied = (val(qryCINLEAVEAPPSM.NOOFDAYS) * (val(qryCLKWORKINGDAYS.WORKINGHOURSFORLV) / val(qryCLKWORKINGDAYS.WORKINGHOURSPDAY))) + (val(GetEntry.LEAVEHOURS) / val(qryCLKWORKINGDAYS.WORKINGHOURSFORLV))>
					<CFELSE>
						<CFSET nHoursApplied = (val(qryCINLEAVEAPPSM.NOOFDAYS) * val(qryCLKWORKINGDAYS.WORKINGHOURSFORLV)) + val(GetEntry.LEAVEHOURS)>
					</CFIF>
					<cfset session.11applied = nHoursApplied>
					<cfset session.11nHoursInDays = nHoursInDays>
	<!---	
					<CFIF nHoursInDays GTE 0>
						<CFSET nHoursInDays=nHoursInDays + 1>
					</CFIF>
	--->
					<!--- update for the user --->
					<CFQUERY NAME="updateAPPSRC" DATASOURCE="#client.company_dsn#">
						UPDATE CINLEAVEAPPSRC
						SET NOOFDAYS = '#nHoursApplied#'
						WHERE DOCNUMBER = '#GETENTRY.DOCNUMBER#'
					</CFQUERY>
					<CFIF nHoursApplied NEQ "" AND nHoursApplied NEQ 0>
						<CFIF Trim(LCase(qryCBR201.LEAVETRACKUNIT)) NEQ "by day">
							<CFSET nHoursInDays=nHoursInDays * qryCLKWORKINGDAYS.WORKINGHOURSPDAY>
						</CFIF>
	
						<CFIF nHoursApplied LTE nHoursInDays>
							<CFSET nLVHours=qryCINLVENTITLEMENT.LEAVEBALANCE>
	
							<CFIF LCase(#GetEntry.WITHPAY#) EQ "Y">
								<CFSET nLVBalance=nLVHours + nHoursApplied>
							<CFELSE>
								<CFSET nLVBalance=nLVHours>
							</CFIF>
	
							<CFOUTPUT>
							<CFIF lPreProcessShowMsg EQ "Yes">
							<tr>
								<!---by jepoy--->
								<td width="25%">
									<table border=0 cellpadding=2 cellspacing=0 width="100%">
									<tr>
										<td nowrap>Personnel ID No.&nbsp;</td>
										<td nowrap width="100%" class="bold">#qryCMFPA.PERSONNELIDNO#</td>
									</tr>
									<tr>
										<td nowrap>Last Name&nbsp;</td>
										<td nowrap width="100%" class="bold">#qryCMFPA.LASTNAME#</td>
									</tr>
									<tr>
										<td nowrap>First Name&nbsp;</td>
										<td nowrap width="100%" class="bold">#qryCMFPA.FIRSTNAME#</td>
									</tr>
									</table>
								</td>
								<td bgcolor="##808080"></td>
								<!---by jepoy END HERE--->
								<td width="25%">
									<table border=0 cellpadding=2 cellspacing=0 width="100%">
									<tr>
										<td nowrap>Leave Type&nbsp;</td>
										<td nowrap width="100%" class="bold">#qryCINLVENTITLEMENT.LEAVETYPE#</td>
									</tr>
									<tr>
										<td nowrap>Leave Balance as of cut-off&nbsp;</td>
										<td nowrap width="100%" class="bold">#qryCINLVENTITLEMENT.LEAVEBALANCE#</td>
									</tr>
									<tr>
										<td nowrap>Leave Balance as of&nbsp;</td>
										<td nowrap width="100%" class="bold">#DateFormat(qryCINLVENTITLEMENT.LEAVEBALANCEASOF, "mm/dd/yyyy")#</td>
									</tr>
									</table>
								</td>
								<td bgcolor="##808080"></td>
								<td width="25%">
									<table border=0 cellpadding=2 cellspacing=0 width="100%">
									<tr>
										<td nowrap>&nbsp;Type&nbsp;</td>
										<td nowrap width="100%" class="bold">#qryCINLVENTITLEMENT.TYPE#</td>
									</tr>
									<tr>
										<td nowrap>&nbsp;Entitlement&nbsp;</td>
										<td nowrap width="100%" class="bold">#qryCINLVENTITLEMENT.LEAVEENTITLEMENT#</td>
									</tr>
									<tr>
										<td nowrap>&nbsp;Start Date&nbsp;</td>
										<td nowrap width="100%" class="bold">#DateFormat(qryCINLVENTITLEMENT.STARTDATE, "mm/dd/yyyy")#</td>
									</tr>
									</table>
								</td>
								<td bgcolor="##808080"></td>
								<td width="25%">
									<table border=0 cellpadding=2 cellspacing=0 width="100%">
									<CFIF UCase(qryCINLVENTITLEMENT.TYPE) IS "EARNED">
										<tr>
											<td nowrap>&nbsp;Availed Leave&nbsp;</td>
											<td nowrap width="100%" class="bold">#qryCINLVENTITLEMENT.AVAILEDLEAVE#</td>
										</tr>
										<tr>
											<td nowrap>&nbsp;Availed Leave as of&nbsp;</td>
											<td nowrap width="100%" class="bold">#DateFormat(qryCINLVENTITLEMENT.AVAILEDLEAVEASOF, "mm/dd/yyyy")#</td>
										</tr>
									<CFELSE>
										<tr>
											<td nowrap>&nbsp;Accrued Balance&nbsp;</td>
											<td nowrap width="100%" class="bold">#qryCINLVENTITLEMENT.ACCRUEDBALANCE#</td>
										</tr>
										<tr>
											<td nowrap>&nbsp;Accrued Balance as of&nbsp;</td>
											<td nowrap width="100%" class="bold">#DateFormat(qryCINLVENTITLEMENT.ACCRUEDBALANCEASOF, "mm/dd/yyyy")#</td>
										</tr>
									</CFIF>
									<CFIF UCase(Evaluate("GetEntry.APPROVED")) NEQ "Y" OR UCase(Evaluate("GetEntry.APPROVED")) NEQ "C">
										<tr>
											<td nowrap>&nbsp;Leave Balance if Approved&nbsp;</td>
											<td nowrap width="100%" class="bold">
												#nLVBalance#
											</td>
										</tr>
									</CFIF>
									</table>
								</td>
							</tr>
							</CFIF>
							<CFSET lPreProcessValidated="Yes">
	
							</CFOUTPUT>
						<CFELSE>
							<CFIF lPreProcessShowMsg EQ "Yes">
							<tr><td nowrap class="bold">No. of days/hours applied exceeds No. of days.</td></tr>
							</CFIF>
						</CFIF>
					<CFELSE>
						<CFIF lPreProcessShowMsg EQ "Yes">
						<tr><td nowrap class="bold">No. of days/hours applied is 0.</td></tr>
						</CFIF>
					</CFIF>
				<CFELSE>
					<CFIF lPreProcessShowMsg EQ "Yes">
					<tr><td nowrap class="bold">Invalid WORKINGDAYSCODE.</td></tr>
					</CFIF>
				</CFIF>
			<CFELSE>
				<CFIF lPreProcessShowMsg EQ "Yes">
				<tr><td nowrap class="bold">Leave Track Unit is not properly configured.</td></tr>
				</CFIF>
			</CFIF>
		<CFELSE>
			<CFIF lPreProcessShowMsg EQ "Yes">
			<tr><td nowrap class="bold">Leave Type not found in CINLVENTITLEMENT table.</td></tr>
			</CFIF>
		</CFIF>
	</CFIF>
<CFELSE>
	<CFIF lPreProcessShowMsg EQ "Yes">
	<tr><td nowrap class="bold">Leave Recall is not valid. Leave being recalled is not inclusive in the applied Leave</td></tr>
	</CFIF>
</CFIF>

<CFIF lPreProcessShowMsg EQ "Yes">
</table>
</CFIF>

